home *** CD-ROM | disk | FTP | other *** search
- /* $Id: arcdraw.h,v 1.0 1996/1/5 08:31:37 $
- * $Log: arcdraw.h,v $
- *
- * Acorn RISC OS draw file format objects*
- *
- */
-
- #ifndef arcdraw_h
- #define arcdraw_h
-
- #
- /* --- Rectangular box: bounding boxes, etc. --- */
-
- typedef struct {int x0, y0, x1, y1;} pldraw_box;
-
- typedef int pldraw_sizetyp;
- typedef int pldraw_coltyp;
- typedef int pldraw_pathwidth; /* 1 word */
- typedef pldraw_box pldraw_bboxtyp;
-
-
- /* Types of join */
-
- typedef enum
- { join_mitred = 0,
- join_round = 1,
- join_bevelled = 2
- } pldraw_jointyp;
-
-
- /* Types of cap specification */
-
- typedef enum
- { cap_butt = 0,
- cap_round = 1,
- cap_square = 2,
- cap_triangle = 3
- } pldraw_captyp;
-
-
- /* Types of winding rule */
-
- typedef enum
- { wind_nonzero = 0,
- wind_evenodd = 1
- } pldraw_windtyp;
-
-
- /* Dash types */
-
- typedef enum
- { dash_absent = 0,
- dash_present = 1
- } pldraw_dashtyp;
-
-
- /* Values used for pack/unpack of draw data */
-
- #define packmask_join 0x03
- #define packmask_endcap 0x0C
- #define packmask_startcap 0x30
- #define packmask_windrule 0x40
- #define packmask_dashed 0x80
- #define packshft_join 0
- #define packshft_endcap 2
- #define packshft_startcap 4
- #define packshft_windrule 6
- #define packshft_dashed 7
-
-
- /* A Path style */
-
- typedef struct
- { unsigned char joincapwind; /* 1 byte */ /* bit 0..1 join */
- /* bit 2..3 end cap */
- /* bit 4..5 start cap */
- /* bit 6 winding rule */
- /* bit 7 dashed */
- unsigned char reserved8; /* 1 byte */
- unsigned char tricapwid; /* 1 byte */ /* 1/16th of line width */
- unsigned char tricaphei; /* 1 byte */ /* 1/16th of line width */
- } pldraw_pathstyle;
-
-
- typedef char pldraw_fontref; /* 1 byte */
-
-
-
- typedef unsigned int pldraw_fontsize; /* 4 bytes, unsigned */
-
-
-
- typedef enum
- { pldraw_OBJFONTLIST = 0,
- pldraw_OBJTEXT = 1,
- pldraw_OBJPATH = 2,
- pldraw_OBJSPRITE = 5,
- pldraw_OBJGROUP = 6,
- pldraw_OBJTEXTAREA = 9,
- pldraw_OBJTEXTCOL = 10
- } pldraw_tagtyp;
-
- typedef struct { int x,y; } pldraw_objcoord;
-
- /* ------------------------------------------------------------------------- *
- *
- * File header
- *
- *
- */
-
- typedef struct
- { char title[4];
- int majorstamp;
- int minorstamp;
- char progident[12];
- pldraw_bboxtyp bbox; /* 4 words */
- } pldraw_fileheader;
-
-
- /* ------------------------------------------------------------------------- *
- * General header for graphic objects
- *
- */
-
- typedef struct
- { pldraw_tagtyp tag; /* 1 word */
- pldraw_sizetyp size; /* 1 word */
- pldraw_bboxtyp bbox; /* 4 words */
- } pldraw_objhdr;
-
-
-
-
- /* ------------------------------------------------------------------------- *
- *
- * Elements within a path *
- *
- */
-
- typedef enum
- { pldraw_PathTERM = 0, /* end of path */
- pldraw_PathMOVE = 2, /* move to (x,y), starts new subpath */
- pldraw_PathLINE = 8, /* line to (x,y) */
- pldraw_PathCURVE = 6, /* bezier curve to (x3,y3) with 2 control points */
- pldraw_PathCLOSE = 5 /* close current subpath with a line */
- } pldraw_path_tagtype;
-
- typedef struct { pldraw_path_tagtype tag; int x,y; } Path_movestr;
-
- typedef struct { pldraw_path_tagtype tag; int x,y; } Path_linestr;
-
- typedef struct { pldraw_path_tagtype tag; int x1,y1;
- int x2,y2; int x3,y3; } Path_curvestr;
-
- typedef struct { pldraw_path_tagtype tag; } Path_closestr;
-
- typedef struct { pldraw_path_tagtype tag; } Path_termstr;
-
- typedef union /* Use ONLY for space checking purposes */
- { Path_movestr a;Path_linestr b;Path_curvestr c;Path_closestr d;Path_termstr e;
- } Largest_path_str;
-
-
- typedef union
- { Path_movestr *move;
- Path_linestr *line;
- Path_curvestr *curve;
- Path_closestr *close;
- Path_termstr *term;
-
- char *bytep;
- int *wordp;
- } Path_eleptr;
-
- /* ------------------------------------------------------------------------- *
- *
- * Optional dashpattern *
- *
- */
-
-
- typedef struct
- { int dashstart; /* 1 word */ /* distance into pattern */
- int dashcount; /* 1 word */ /* number of elements */
- } pldraw_dashstrhdr;
-
- typedef struct
- { int dashstart; /* 1 word */ /* distance into pattern */
- int dashcount; /* 1 word */ /* number of elements */
- int dashelements[6]; /* dashcount words */ /* elements of pattern */
- } pldraw_dashstr;
-
-
- /* ------------------------------------------------------------------------- *
- *
- * Unpacked joint,start cap,end cap structure - as fed to drawmod_stroke etc *
- *
- */
-
- typedef struct
- { char join;
- char endcap;
- char startcap;
- char reserved; /* must be zero */
- int mitrelimit;
- short endtricapwid;
- short endtricaphei;
- short starttricapwid;
- short starttricaphei;
- } pldraw_jointspec;
-
-
- /* ------------------------------------------------------------------------- *
- *
- * A path
- *
- */
-
- typedef struct
- { pldraw_tagtyp tag; /* 1 word */
- pldraw_sizetyp size; /* 1 word */
- pldraw_bboxtyp bbox; /* 4 words */
- pldraw_coltyp fillcolour; /* 1 word */
- pldraw_coltyp pathcolour; /* 1 word */
- pldraw_pathwidth pathwidth; /* 1 word */
- pldraw_pathstyle pathstyle; /* 1 word */
- } pldraw_pathstrhdr;
-
- typedef struct
- { pldraw_tagtyp tag; /* 1 word */
- pldraw_sizetyp size; /* 1 word */
- pldraw_bboxtyp bbox; /* 4 words */
- pldraw_coltyp fillcolour; /* 1 word */
- pldraw_coltyp pathcolour; /* 1 word */
- pldraw_pathwidth pathwidth; /* 1 word */
- pldraw_pathstyle pathstyle; /* 1 word */
-
- pldraw_dashstr data; /* optional dash pattern, then path elements */
- int PATH;
- } pldraw_pathstr;
-
-
-
- #endif
-
- /* end of drawtypes.h */
-
-